1. Field of the Invention
The present invention relates to object-relational databases. More specifically, the present invention relates to a method and an apparatus to facilitate transactional consistency for references in object-relational databases.
2. Related Art
Object-relational databases typically support navigational accesses that allow object-oriented programs to access objects within the database. During a navigational access, applications process objects by following a reference to an initial set of objects, and then use references within these initial objects to traverse the remaining objects.
Typically, an object-oriented application using navigational access first retrieves one or more objects from a database server, possibly by issuing a structured query language (SQL) statement, which returns references to these objects. The application then pins these objects and navigates from them to other objects by following the references. Pinning the object involves transferring a copy of the object to a local data structure, and locking the object within the database so that other applications cannot change the data until the object is unpinned using either a commit or abort operation. After a commit or abort operation, the reference is considered to be undefined, therefore the reference must be pinned again before operations can resume on the object.
While an object is pinned, it is common for many references to be established to that object. After an abort or a commit, each of these references are typically invalidated and must be individually reestablished before subsequent operations can resume on the object. While this method ensures integrity of the object, it is inefficient, wastes computing resources, and reduces system throughput. Since it is common to pin an object, make changes to the object, commit the changes, and then make additional changes to the same object, these references are being continually established and destroyed.
What is needed is a method and an apparatus to facilitate transactional consistency for references to object-relational databases without the problems described above.